<?php
class Inscription_m extends Model{
      function Inscription_m(){
          parent::Model();
          $this->load->database();
      }
   function get_sports(){
        $query=$this->db->get('sports');
        return $query->result_array();
   }
   function get_recherche(){
        $query=$this->db->get('recherche');
        return $query->result_array();
   }
   function get_secteur(){
        $query=$this->db->get('secteur');
        return $query->result_array();
   }
    function add_inscription($data){
          return $this->db->insert('inscription',$data);
      }
    function update_inscription($id,$data){
          return $this->db->update('inscription',$data,array('id'=>$id));
      }
 function get_adherent_by_id($id){
        $query=$this->db->get_where('inscription',array('id'=>$id));
         return $query->row();
     }

    function get_image_by_name($name){
        $query=$this->db->get_where('image',array('name'=>$name));
        //$this->db->order_by('id','DESC');
        return $query;         
     }
       function check_inscription($email){
          $query = $this->db->get_where('inscription', array('email'=>$email));
          return $query;
          
      }
       function get_mail($id){
           $this->db->select();
           $this->db->from('mail_auto');
            $this->db->where("id",$id);
           $query=$this->db->get();
           return $query->row_array();
     }
}
?>
